package com.victor.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.victor.entity.Recharge;

@Mapper
public interface RechargeDao {
	// 添加数据
	@Insert("insert into recharge (userid,money,actualmoney,time,status,ordernumber,payment,sid,pictype,couponid) "
			+ "values(#{userid},#{money},#{actualMoney},now(),0,#{ordernumber},#{payment},#{sid},#{pictype},#{couponid})")
	public boolean add(Recharge recharge);

	// 修改状态
	@Update("update recharge set status=1 where ordernumber=#{ordernumber}")
	public boolean upStatus(String orderNumber);

	// 回调
	@Select("select * from recharge where ordernumber=#{ordernumber}")
	public Recharge query(String orderNumber);
}
